/**
 * Created by Bella on 21/04/2014.
 */
public class HitsData implements Comparable<HitsData>{

    private double hubness;
    private double authority;
    private String id;

    public HitsData(String id) {
        hubness = 1.0;
        authority = 1.0;
        this.id=id;
    }

    public void setHubness(double hubness) {
        this.hubness = hubness;
    }

    public void setAuthority(double authority) {
        this.authority = authority;
    }

    public double getHubness() {
        return hubness;
    }

    public double getAuthority() {
        return authority;
    }

    public String getId() {
        return id;
    }

    @Override
    public int compareTo(HitsData hitsData) {
        if(this.getAuthority() - hitsData.getAuthority() > Search.threshold)
            return -1;

        if(this.getAuthority() - hitsData.getAuthority() < -Search.threshold)
            return 1;

        return 0;
    }

    @Override
    public String toString() {
        return "HitsData{" +
                "hubness=" + hubness +
                ", authority=" + authority +
                ", id='" + id + '\'' +
                '}'+"\n";
    }
}
